﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Configuration;

namespace MayfairFramework.Common.DI
{
    public class DIContainerFactory
    {
        private static DIContainer instance;

        public static DIContainer GetDIContainer()
        {
            try
            {
                if (instance == null)
                {
                    Assembly exe = Assembly.GetExecutingAssembly();
                    instance = (DIContainer)exe.CreateInstance(ConfigurationSettings.AppSettings["DIContainer"]);
                }
                return instance;
            }
            catch (Exception e)
            {
                throw new Exception("DIContainerの生成に失敗しました", e);
            }
        }
    }
}
